<form class="f" action="?#f" method="POST">
  <div class="grybox">
    <h1><?php if (isset($isEdit)) : ?><?php if (isset($isExpired)) : ?>View<?php else : ?>Edit<?php endif; ?><?php else : ?>Add<?php endif; ?> Offer</h1>
    <div class="fmArea">
      <?php echo include_partial('global/errorsList', array('forms' => array($form), 'global' => $errorCollector)); ?>
      <?php if ($sf_request->hasParameter('success')) : ?><div class="succDis"><?php echo LangUtil::getText('message_save_success'); ?></div><?php endif; ?>
      <div class="singleColumn">

        <h2 style="color: red;">
        <?php if (isset($isExpired)) : ?>
        This offer is already expired! You cannot edit expired offers.
        <?php endif ;?>
        </h2>
        
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_OFFER_CODE]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[OfferForm::FIELD_OFFER_CODE]->render(array('class'=>'txtBox2', 'readonly'=>'readonly')); ?></div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_MOVIE_TITLE]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[OfferForm::FIELD_MOVIE_TITLE]->render(array('class'=>'txtBox1', 'readonly' => (isset($isEdit) ? 'readonly' : ''))); ?><?php if (!isset($isEdit)) : ?>  <input type="button" value="Search" id="fetch_movie_info" class="buttnSrh" /><?php endif; ?><?php echo $form[OfferForm::FIELD_IS_MOVIE_NONEMPTY]->render(); ?> <img src="/images/admin/ajax-loader.gif" id="ajax-loader" style="display: none;" alt="" /></div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_SESSION_TIME_D]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox">
            <?php if ($isReadOnly) : ?>
              <?php echo StringUtil::getDisplayDate($offer->getMerchantsSessionTime(), true); ?>
            <?php endif; ?>
            <?php if ($isReadOnly) : ?><span style="display: none;"><?php endif; ?>
              <?php echo $form[OfferForm::FIELD_SESSION_TIME_D]->render(array('class'=>'txtBox2', 'style' => 'width: 80px;')); ?>
              <?php echo $form[OfferForm::FIELD_SESSION_TIME_T]->render(array('class'=>'txtBox2', 'style' => 'width: 80px;')); ?>
              (24 hour time format - HH:MM)
            <?php if ($isReadOnly) : ?></span><?php endif; ?>
            <!--(e.g. 2012-05-28 20:15)-->
          </div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_MOVIE_TRAILER_URL]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[OfferForm::FIELD_MOVIE_TRAILER_URL]->render(array('class'=>'txtBox1', 'readonly' => ($isReadOnly ? 'readonly' : ''))); ?></div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_CINEMA]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php if (isset($isEdit)) : ?><?php $arrCinemaList = CINEMATable::getInstance()->findAllArray(); if ($form[OfferForm::FIELD_CINEMA]->getValue()) { echo $form[OfferForm::FIELD_MOVIE_TITLE]->render(array('class'=>'txtBox1', 'readonly' => 'readonly', 'value' => $arrCinemaList[$form[OfferForm::FIELD_CINEMA]->getValue()])); } ?><?php echo $form[OfferForm::FIELD_CINEMA]->render(array('style'=>'display:none;')); ?><?php else : ?><?php echo $form[OfferForm::FIELD_CINEMA]->render(array('class'=>'drpBox1')); ?><?php endif; ?></div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FILED_SCREEN_NO]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[OfferForm::FILED_SCREEN_NO]->render(array('class'=>'drpBox1', 'disabled' => ((($isReadOnly && !isset($isActive)) || isset($isExpired)) ? 'disabled' : ''))); ?></div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_VALID_FROM_D]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox">
            <?php if ($isReadOnly) : ?>
              <?php echo StringUtil::getDisplayDate($offer->getMerchantsValidFrom(), true); ?>
            <?php endif; ?>
            <?php if ($isReadOnly) : ?><span style="display: none;"><?php endif; ?>
              <?php echo $form[OfferForm::FIELD_VALID_FROM_D]->render(array('class'=>'txtBox2', 'style' => 'width: 80px;')); ?>
              <?php echo $form[OfferForm::FIELD_VALID_FROM_T]->render(array('class'=>'txtBox2', 'style' => 'width: 80px;')); ?>
              (24 hour time format - HH:MM)
            <?php if ($isReadOnly) : ?></span><?php endif; ?>
          </div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_VALID_TO_D]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox">
          <?php echo $form[OfferForm::FIELD_VALID_TO_D]->render(array('class'=>'txtBox2', 'style' => 'width: 80px;', 'readonly' => ((($isReadOnly && !isset($isActive)) || isset($isExpired)) ? 'readonly' : ''))); ?>
          <?php echo $form[OfferForm::FIELD_VALID_TO_T]->render(array('class'=>'txtBox2', 'style' => 'width: 80px;', 'disabled' => ((($isReadOnly && !isset($isActive)) || isset($isExpired)) ? 'disabled' : ''))); ?>
            (24 hour time format - HH:MM)
          </div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_TICKET_PRICE]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[OfferForm::FIELD_TICKET_PRICE]->render(array('class'=>'txtBox2', 'readonly' => ($isReadOnly ? 'readonly' : ''))); ?> AUD</div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_SEATS_COUNT]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[OfferForm::FIELD_SEATS_COUNT]->render(array('class'=>'txtBox2', 'readonly' => ($isReadOnly ? 'readonly' : ''))); ?></div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_SEATS_FROM]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[OfferForm::FIELD_SEATS_FROM]->render(array('class'=>'txtBox2', 'readonly' => ((($isReadOnly && !isset($isActive)) || isset($isExpired)) ? 'readonly' : ''))); ?></div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_SEATS_TO]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[OfferForm::FIELD_SEATS_TO]->render(array('class'=>'txtBox2', 'readonly' => ((($isReadOnly && !isset($isActive)) || isset($isExpired)) ? 'readonly' : ''))); ?></div>
        </div>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_ADDITIONAL_INFO]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[OfferForm::FIELD_ADDITIONAL_INFO]->render(array('class'=>'txtBox1', 'readonly' => ((($isReadOnly && !isset($isActive)) || isset($isExpired)) ? 'readonly' : ''))); ?></div>
        </div>
        
        <?php if ((!$isReadOnly || isset($isActive)) && !isset($isExpired)) : ?>
        <div class="frmRow">
          <?php echo $form[OfferForm::FIELD_STATUS]->renderLabel(null, array('class'=>'frmLable')); ?>
          <div class="frmtxtBox"><?php echo $form[OfferForm::FIELD_STATUS]->render(array('class'=>'drpBox1')); ?></div>
        </div>
        <?php endif; ?>
      </div>

      <div class="offer-help-contact">
        <p>
          <strong><u>24/7 Help / Assistance</u></strong><br /><br />
          Telephone: 1300783988<br />
          Chat: info@supertain.me
        </p>
      </div>
      
      <div class="butArea">
        <?php if ((!$isReadOnly || isset($isActive)) && !isset($isExpired)) : ?>
        <input name="" id="smt" type="submit" class="buttnSrh11" value="Save Changes" />
        <?php else : ?>
        <input name="" type="button" class="buttnSrh11" value="Copy to New" onClick="document.location.href='<?php echo url_for('@offer_add?cid=' . $sf_request->getParameter('id')); ?>'" />
        <?php endif; ?>
      </div>

    </div>
  </div>
  <?php echo $form['_csrf_token']->render(); ?>
  
</form>

<?php if (isset($isCopy)) : ?>
<input type="hidden" id="offer_is_copy" value="1" />
<?php endif; ?>